package com.module.prms.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import base.dao.GenericHibernateDao;

import com.module.prms.vo.PrmsUserRole;



public class UserRoleDao extends GenericHibernateDao<PrmsUserRole, String> {

	private UserRoleDao(){}
	
	private static UserRoleDao dao;
	
	public synchronized static UserRoleDao getInstance(){
		if(dao == null )
			dao = new UserRoleDao();
		return dao;
	}
	
	public List getUserRole(Session session,String userid)
	{
	        StringBuffer sb = new StringBuffer();
	        sb.append("from PrmsUserRole as obj where obj.cuserId=?");
	        Query query = session.createQuery(sb.toString());
	        query.setString(0, userid);
	        List list = query.list();
	        return list;
	}
	
}
